-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Populate UserContext.SocialSecurityNumber
in UserHelper
#930
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
danielskovli
commented
Nov 27, 2024
danielskovli
commented
Nov 27, 2024
martinothamar
approved these changes
Nov 28, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, though I think over time these abstractions will be replaced with this: #880
martinothamar
approved these changes
Nov 29, 2024
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The main purpose of this PR is modify the method
UserHelper.GetUserContext()
to populate the propertyUserContext.SocialSecurityNumber
.However, I found the flow of that method to be a bit hard to follow, which is the reason for the refactoring. And because those changes potentially modifies the logic of the method, I added a test.
Investigation needed?
I disagreed with the original logic for assignment ofUserProfile.Party
, so I changed it. At least with our test data,UserProfile.PartyId
was not a good indicator to tell ifUserProfile.Party
contained valid information. The check now inspectsUserProfile.Party?.PartyId
instead.If someone actually wants the original value, this is stored inUserProfile.UserParty
anyway.As for whether this impacts existing usage, it would be nice to get a second pair of eyes on the situation. Comparingapp-lib-dotnet
test data withapp-localtest
(for instance1337.json
), it appears that the change is beneficial to incomplete data sets (app-lib-dotnet
, emptyparty
definition) and will not affect behaviour for complete data sets (app-localtest
).After some back and forth on Slack, we have decided to leave the original
Party
assignment logic intact. Too many unknowns associated with this modification.Motivation
A question was recently asked about limiting app access to a list of known national identity numbers (social security numbers): https://digdir.slack.com/archives/C079ZFUSFMW/p1732624713911909
The general recommendation was to solve this in the app code as opposed to XACML. Getting hold of the information seemed easiest with the help of
UserHelper
, but for some reason this did not populate the SSN field.Another baffling question is why the national identity number is part of the
Party
definition and not, say,UserProfile
. But I'm sure that makes sense to someone else.Verification
Documentation